package nc.task.hdysc;

import java.util.List;
import java.util.Map;

import nc.bs.dao.BaseDAO;
import nc.bs.dao.DAOException;
import nc.hdysc.engine.impl.BaseSyncDataImpl;
import nc.hdysc.engine.itf.ISyncTask;
import nc.hdysc.pub.BaseUtil;
import nc.jdbc.framework.processor.MapListProcessor;
import nc.vo.bd.b04.DeptdocVO;
import nc.vo.hdysc.crs_guide_addserver.CrsGuideAddserverVO;
import nc.vo.hdysc.crs_other_option.CrsOtherOptionVO;
import nc.vo.hdysc.engine.SyncTaskVO;
import nc.vo.pub.lang.UFBoolean;
import nc.vo.pub.lang.UFDate;

public class OtherOptionTask extends BaseSyncDataImpl<CrsOtherOptionVO> implements ISyncTask<CrsOtherOptionVO>  {

	
	//private SyncTaskVO syncTaskVO;
	public OtherOptionTask() throws DAOException, InstantiationException, IllegalAccessException, ClassNotFoundException {
		super( CrsOtherOptionVO.class);
	}

	public List<CrsOtherOptionVO> getDstDate() throws DAOException {
		List<CrsOtherOptionVO> depList = (List<CrsOtherOptionVO>) dDao.retrieveAll(CrsOtherOptionVO.class);
		return depList;
	}

	public List<Map<String, Object>> getSourceDate() throws DAOException {
		String sql = "select * from tbdGroupOtherFlag";
		List<Map<String, Object>> depList = (List<Map<String, Object>>) sDao.executeQuery(sql, new MapListProcessor());
		return depList;
	}

	public SyncTaskVO getSyncTask() throws DAOException {
		SyncTaskVO syncTask = null;
		BaseDAO dao = new BaseDAO();
		syncTask = (SyncTaskVO) dao.retrieveByPK(SyncTaskVO.class, "0001AA1000000000UDER");
		return syncTask;
	}

	public CrsOtherOptionVO beforeUpdateOrInsert(CrsOtherOptionVO t) {
		return t;
	}

	public int compare(CrsOtherOptionVO sVO, CrsOtherOptionVO dVO) {
		int compare = -1;
		String dCompare = dVO.getIorder().toString();
		String sCompare = sVO.getIorder().toString();
		if(!BaseUtil.emptyOrNull(dCompare) && !BaseUtil.emptyOrNull(sCompare) && dCompare.equals(sCompare)){
			compare =  1;
		}
		return compare;
		
		
	}

}
